﻿
/* ==============================================================================
*
*   Copyright (c) 2010, Pierre Favier
*   All rights reserved.
*
*   NTasking is free software: you can redistribute it and/or modify it
*   under the terms of the GNU General Public License as published by the
*   Free Software Foundation.
*
*   Redistribution and use in source and binary forms, with or without
*   modification, are permitted provided that the following conditions
*   are met:
*
*   -   Redistributions of source code must retain the above copyright notice,
*       this list of conditions and the following disclaimer.
*
*   -   Redistributions in binary form must reproduce the above
*       copyright notice, this list of conditions and the following
*       disclaimer in the documentation and/or other materials
*       provided with the distribution.
*
*   THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
*   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
*   OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
*   DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
*   BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
*   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
*   TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
*   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
*   ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
*   TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
*   THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
*   SUCH DAMAGE.
*
* ============================================================================== */

// This code has been generated by the T4 engine. DO NOT EDIT otherwise your changes
// will be overwritten at next generation

using System;
using Void = NTasking.Internals.Void;

namespace NTasking
{

    /// <summary>
    /// Define methods for support of Ada syntactic constructs which can't be implemented
    /// without a prefix
    /// </summary>
    public static partial class Ada
    {
                
        public static Future<RetT> Async<RetT>(this Func<RetT> entry)
        {
            return GetCallable<Func<Future<RetT>>>(entry).AsynchronousCall()();
        }


        public static Future Async(this Action entry)
        {
            return GetCallable<Func<Future<Void>>>(entry).AsynchronousCall()();
        }

        
        public static Future<RetT> Async<P1T, RetT>(this Func<P1T, RetT> entry, P1T p1)
        {
            return GetCallable<Func<P1T, Future<RetT>>>(entry).AsynchronousCall()(p1);
        }


        public static Future Async<P1T>(this Action<P1T> entry, P1T p1)
        {
            return GetCallable<Func<P1T, Future<Void>>>(entry).AsynchronousCall()(p1);
        }

        
        public static Future<RetT> Async<P1T, P2T, RetT>(this Func<P1T, P2T, RetT> entry, P1T p1, P2T p2)
        {
            return GetCallable<Func<P1T, P2T, Future<RetT>>>(entry).AsynchronousCall()(p1, p2);
        }


        public static Future Async<P1T, P2T>(this Action<P1T, P2T> entry, P1T p1, P2T p2)
        {
            return GetCallable<Func<P1T, P2T, Future<Void>>>(entry).AsynchronousCall()(p1, p2);
        }

        
        public static Future<RetT> Async<P1T, P2T, P3T, RetT>(this Func<P1T, P2T, P3T, RetT> entry, P1T p1, P2T p2, P3T p3)
        {
            return GetCallable<Func<P1T, P2T, P3T, Future<RetT>>>(entry).AsynchronousCall()(p1, p2, p3);
        }


        public static Future Async<P1T, P2T, P3T>(this Action<P1T, P2T, P3T> entry, P1T p1, P2T p2, P3T p3)
        {
            return GetCallable<Func<P1T, P2T, P3T, Future<Void>>>(entry).AsynchronousCall()(p1, p2, p3);
        }

        
        public static Future<RetT> Async<P1T, P2T, P3T, P4T, RetT>(this Func<P1T, P2T, P3T, P4T, RetT> entry, P1T p1, P2T p2, P3T p3, P4T p4)
        {
            return GetCallable<Func<P1T, P2T, P3T, P4T, Future<RetT>>>(entry).AsynchronousCall()(p1, p2, p3, p4);
        }


        public static Future Async<P1T, P2T, P3T, P4T>(this Action<P1T, P2T, P3T, P4T> entry, P1T p1, P2T p2, P3T p3, P4T p4)
        {
            return GetCallable<Func<P1T, P2T, P3T, P4T, Future<Void>>>(entry).AsynchronousCall()(p1, p2, p3, p4);
        }

    }

}
